home *** CD-ROM | disk | FTP | other *** search
/ Total Network Tools 2002 / NextStepPublishing-TotalNetworkTools2002-Win95.iso / Archive / Misc Servers / Hamster.EXE / Demo-Session.hsc < prev    next >
Encoding:
Text File  |  2000-05-07  |  3.4 KB  |  108 lines

  1. #!hs2
  2. #!load hamster.hsm
  3.  
  4.  
  5. ########################################################################
  6. # Script     : Demo-Session.hsc
  7. # Description: Script, which demonstrates a complete session.
  8. # Maintainer : Juergen Haible <juergen.haible@t-online.de>
  9. # Version    : 2000-05-07
  10. ########################################################################
  11. # NOTE:
  12. # This script is delivered with Hamster and it will be overwritten when
  13. # installing a new version of it. Therefore, it's disabled in Hamster's
  14. # script-menu.
  15. # You have to make a copy of this script (e.g. "MyScript.hsc") and edit
  16. # it to suit your needs before using it. Please note also, that you have
  17. # to restart Hamster before the copied script becomes visible in the
  18. # script-menu.
  19. ########################################################################
  20.  
  21.  
  22. ########################################################################
  23. # Make sure, that Hamster is new enough to run this script
  24. ########################################################################
  25.  
  26. HamRequireVersion( "1.3.18.0", True )
  27.  
  28.  
  29. ########################################################################
  30. # Settings and preferences
  31. ########################################################################
  32.  
  33. # Dialup-settings
  34. var( $RASDIAL_CONNECTION, $RASDIAL_USERNAME, $RASDIAL_PASSWORD )
  35. $RASDIAL_CONNECTION = ""     # Name of RAS-conn; "" = disable dialing
  36. $RASDIAL_USERNAME   = ""     # Username for RAS-conn; "" = use Hamster-setting
  37. $RASDIAL_PASSWORD   = ""     # Password for RAS-conn; "" = use Hamster-setting
  38.  
  39. # Purge-settings
  40. var( $PURGE_BEFORE_TRANSFER )
  41. $PURGE_BEFORE_TRANSFER = False  # True = enable purging
  42.  
  43.  
  44. ########################################################################
  45. # Purging
  46. ########################################################################
  47.  
  48. if( $PURGE_BEFORE_TRANSFER )
  49.    print( "Purging ..." )
  50.    HamWaitIdle
  51.    HamPurge
  52.    HamWaitIdle
  53. endif
  54.  
  55.  
  56. ########################################################################
  57. # Dialing
  58. ########################################################################
  59.  
  60. var( $RASERR )
  61.  
  62. if( $RASDIAL_CONNECTION<>"" )
  63.    print( "Dialing ..." )
  64.    $RASERR = HamRasDial( $RASDIAL_CONNECTION, $RASDIAL_USERNAME, $RASDIAL_PASSWORD )
  65.    if( $RASERR<>0 )
  66.       Error( "Error dialing ", $RASDIAL_CONNECTION, "! RAS-Error=", $RASERR )
  67.    endif
  68. endif
  69.  
  70.  
  71. ########################################################################
  72. # Transfering news and mails
  73. ########################################################################
  74.  
  75. print( "Transfering ..." )
  76.  
  77. # Start sending and retrieving of mails
  78. # HamSendMail( <server>, <port>, <from-select> )
  79. # HamFetchMail( <server>, <port>, <user>, <pass>, <destuser>, <filter> )
  80. HamMailExchange
  81.  
  82. # Start sending and retrieving of news
  83. HamNewsPost
  84. HamNewsPull
  85.  
  86. # Wait until all transfer-threads have finished
  87. HamWaitIdle
  88.  
  89.  
  90. ########################################################################
  91. # Hanging up
  92. ########################################################################
  93.  
  94. if( $RASDIAL_CONNECTION<>"" )
  95.    print( "Hanging up ..." )
  96.    HamRasHangup
  97. endif
  98.  
  99.  
  100. ########################################################################
  101. # The End.
  102. ########################################################################
  103.  
  104. print( "Ready." )
  105. quit
  106.  
  107. ########################################################################
  108.